<template>
  <div>
    <h1>Test</h1>
    <p>count的值为: {{ store.count }}</p>
    <p>doubleCount的值为: {{ store.doubleCount }}</p>
    <button @click="changeCount">count++</button>
    <button @click="changeCountAsync">1s后count++</button>
  </div>
</template>

<script setup>
// 导入pinia仓库
import { useTestStore } from '@/stores/test'
// 可以在组件中的任意位置访问store对象
const store = useTestStore ()
// console.log(store.count)

function changeCount() {
  store.update()
}
function changeCountAsync() {
  store.asyncUpdate()
}
</script>

<style lang="scss" scoped>
</style>